Returns a date value from a date string. The date string is a complete date in a single numeric value. You can also use this serial number to determine the difference between two dates.
日付文字列から日付の値を返します。日付文字列は 1 つの数値で表される完全な日付です。このシリアル値を使用して、2 つの日付の間の差を調べることもできます。
DateValue [(date)]
DateValue [(date)]
Date
日付
Date: String expression that contains the date that you want to calculate. The date can be specified in almost any format.
Date: 変換する日付データを示す文字列表式。日付を示す書式は、各種のフォーマットが使用できます。
You can use this function to convert a date that occurs between December 1, 1582 and December 31, 9999 into a single integer value. You can then use this value to calculate the difference between two dates. If the date argument lies outside the acceptable range, Office Basic returns an error message.
この関数の変換範囲は 1582 年 12 月 1 日から 9999 年 12 月 31 日までの日付で、これらの日付を該当する数値に変換します。こうして変換される数値を用いると、異なる日付間の日数計算などが行えます。なお引数に指定した日付が上記の範囲を超えている場合、Office Basic はエラーメッセージを表示します。
In contrast to the DateSerial function that passes years, months, and days as separate numeric values, the DateValue function passes the date using the format "month.[,]day.[,]year".
DateSerial 関数の場合は年、月、日を個別の値として指定するのに対して、DateValue 関数の場合は「年.[,]月.[,]日」の形式で一括して指定します。
Sub ExampleDateValue
Sub ExampleDateValue
msgbox DateValue("12/02/1997")
msgbox DateValue("1997/12/02")
end sub
end sub